package cn.driver.manager.service.impl;

import cn.driver.common.pojo.Notice;
import cn.driver.manager.mapper.NoticeMapper;
import cn.driver.manager.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private NoticeMapper noticeMapper;

    @Override
    public List<Notice> getNoticeList() {
        return noticeMapper.getNoticeList();
    }

    @Override
    public boolean addNotice(String title, Date annouceTime, String text, String publisher, String cover) {
        return noticeMapper.addNotice(title, annouceTime, text, publisher, cover) == 1;
    }

    @Override
    public boolean updateNotice(int id, String title, String text, String cover) {
        return noticeMapper.updateNotice(id, title, text, cover) == 1;
    }

    @Override
    public boolean deleteNotice(int id) {
        return noticeMapper.deleteNotice(id) == 1;
    }
}
